In [ ]:
using Plots
gr()

1D Graphs


In [2]:
x=collect(0:.1:4π)
y=cos.(x)
plot(x,y)


Out[2]:
0.0 2.5 5.0 7.5 10.0 12.5 -0.5 0.0 0.5 1.0 y1

In [3]:
scatter(x,y)


Out[3]:
0 5 10 -1 0 1 y1

In [4]:
bar(x,y)


Out[4]:
0 5 10 -0.5 0.0 0.5 1.0 y1

In [5]:
plot(sin, x->sin(2x), 0, 2π)


Out[5]:
-0.5 0.0 0.5 -0.5 0.0 0.5 y1

In [10]:
# Note, hline(Real) doesn't work.   Must be hline(Array{Real})
plot(x,y)
hline!([1])
hline!([0,-1])
vline!(0:π:4π)


Out[10]:
0 5 10 -1.0 -0.5 0.0 0.5 1.0 y1 y2 y3 y4

2D Graphs


In [ ]:
x2d=repmat(x,1,length(x))
y2d=repmat(transpose(x),length(x),1)
z2d=sin.(x2d).*sin.(y2d);

In [ ]:
heatmap(x,x,z2d)

In [ ]:
f(x,y) = sin(x)*sin(y)

#Z = map(f, x2d, y2d)

plot(contour(x2d, y2d, f, fill=true))

#p2 = contour(x, y, Z)

In [ ]:
X = repmat(reshape(x,1,:), length(y), 1)
Y = repmat(y, 1, length(x))

In [ ]:
y2d

Statistics Graphs


In [ ]:
histogram(randn(100))

In [ ]:
histogram2d(randn(1000),randn(1000))